@include('index.public.__head')
	<div class="container">
		<div class="row">
			<div class="col-sm-12 col-md-8">
				<h1 class="article-title">{{$articleInfo->title}}</h1>
				<div class="status">{{$articleInfo->click}}阅读-{{$articleInfo->comm_num}}评论-作者：{{$articleInfo->members->nickname}}
                    @foreach (strToArr($articleInfo->tags) as $vo)
					<span class="label label-default">{{$vo}}</span>
                    @endforeach
				</div>
				<div class="article-content">
					<blockquote>
						{{$articleInfo->desc}}
					</blockquote>
					{!!$articleInfo->content!!}
				</div>
				<div class="article-comment">
					<div class="page-header"><b>相关评论</b></div>
					<div class="comment-content">
						<form action="#">
							<input type="hidden" name="article_id" value="{{$articleInfo->id}}">
							<input type="hidden" name="member_id" value="{{session('index.id')}}">
							<div class="form-group">
								<textarea class="form-control" id="content" name="content" rows="5" cols=""></textarea>
							</div>
							<div class="form-group pull-right">
								<button class="btn btn-primary" id="commAdd">评论（请认真评论）</button>
							</div>
						</form>
					</div>
					<div class="clearfix"></div>
					<div class="comment-list">
                        @foreach ($articleInfo->comments as $vo)
						<div class="comment-list-item">
							<div class="info">{{$vo->members->nickname}}<small>{{$vo->created_at}}</small></div>
							<div class="content">{{$vo->content}}</div>
						</div>
                        @endforeach
					</div>
				</div>
			</div>
			<div class="col-sm-12 col-md-4">
				<div class="affix">
					<div class="page-header h3">推荐文章</div>
					<div class="topic-list">
                    @foreach ($topArticles as $vo)
						<div class="topic-list-item">
							<a href="{{url('info', ['id' => $vo->id])}}" class="title">{{$vo->title}}</a>
						</div>
                    @endforeach
					</div>
				</div>
			</div>
		</div>
	</div>
	<div class="footer">
		<p>Copyright 2018 <a href="#">www.dreamphp.com.cn</a> All Rights Reserved</p>
	</div>
	
	@include('index.public.__js')
	<script>
		$('#commAdd').click(function () {
			if ("{{session('index.id')}}") {
				$.ajax({
				url:"{{url('comm')}}",
				type:'post',
				data:$('form').serialize(),
				dataType:'json',
				success:function (data) {
					if (data.code == 1) {
						layer.msg(data.msg, {
							icon:6,
							time:2000
						}, function () {
							location.reload();
						});
					}else {
						layer.open({
							title:'评论失败',
							content:data.msg,
							icon:5,
							anim:6
						});
					}
				}
			});
			}else {
				layer.msg('请先登录', {
					icon:5,
					time:2000
				}, function () {
					location.href = "{{url('login')}}";
				});
			}
			return false;
		});
	</script>
</body>
</html>